package com.ctshk.rpc.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.system.dto.mian.data.MainDataSubjectDTO;
import com.ctshk.rpc.system.entity.MainDataSubject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 主数据 - 科目 Mapper 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-06-22
 */
public interface MainDataSubjectMapper extends BaseMapper<MainDataSubject> {

    /**
     * 根据业务类型查询
     * @param businessType
     * @param collectionType
     * @return
     */
    @Select("SELECT id,business_type,number,`name`,type,summary,collection_type,`status`\n" +
            "FROM t_main_data_subject\n" +
            "WHERE business_type = #{business_type} AND collection_type = #{collection_type} AND is_deleted = 0 LIMIT 1")
    MainDataSubjectDTO queryByCondition(@Param("business_type") Integer businessType, @Param("collection_type") Integer collectionType);
}
